// Log.h: interface for the Log class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LOG_H__E967C717_AA6A_4176_BADD_9398EBF833FE__INCLUDED_)
#define AFX_LOG_H__E967C717_AA6A_4176_BADD_9398EBF833FE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>

class CardDataLog
{
public:
	CardDataLog(int stationId) {
		m_StationId = stationId;
		logFile = NULL;
		m_Mode = 0;
		m_IsFollowPrint = FALSE;
	};

	CardDataLog() {
		m_StationId = 0;
		logFile = NULL;
		m_Mode = 0;
		m_IsFollowPrint = FALSE;
	};

	void setStationId(int id) {
		m_StationId = id;
	};

	void setTransmitApdu(LPCTSTR cmd, LPCTSTR resp);

	void setExpResp(LPCTSTR expResp) {
		strcpy(m_ExpResp, expResp);
	};

	CString getLog() {
		return CString(m_ApduLog);
	};

	void setKeyHostCmd(LPCTSTR cmd) {
		m_ApduLog[0] = 0;
		strcpy(m_ApduLog, cmd);
	};

	void setKeyHostResp(LPCTSTR resp);

	void printLog();

	void closeLogFile() {
		if(logFile != NULL) {
			fclose(logFile);
			logFile = NULL;
		}

		m_IsFollowPrint = FALSE;
	};

	void setMode(int mode) {
		m_Mode = mode;
	};

	void setFollowPrint(BOOL tag) {
		m_IsFollowPrint = tag;
	};

protected:
	int  m_StationId;
	char m_ApduLog[1200];
	char m_ExpResp[600];
	int m_Mode;
	BOOL m_IsFollowPrint;

	FILE *logFile;
};


#endif // !defined(AFX_LOG_H__E967C717_AA6A_4176_BADD_9398EBF833FE__INCLUDED_)
